// **********************************************************************
//
// Copyright (c) 2003-2008 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
//
// **********************************************************************

// Ice version 3.3.0

package CustomerRelationsManagement;

public final class customerPrxHelper extends Ice.ObjectPrxHelperBase implements customerPrx
{
    public void
    delete()
        throws DBError,
               RecordNotCommitted
    {
        delete(null, false);
    }

    public void
    delete(java.util.Map<String, String> __ctx)
        throws DBError,
               RecordNotCommitted
    {
        delete(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    delete(java.util.Map<String, String> __ctx, boolean __explicitCtx)
        throws DBError,
               RecordNotCommitted
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("delete");
                __delBase = __getDelegate(false);
                _customerDel __del = (_customerDel)__delBase;
                __del.delete(__ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public int
    getId()
        throws RecordNotCommitted
    {
        return getId(null, false);
    }

    public int
    getId(java.util.Map<String, String> __ctx)
        throws RecordNotCommitted
    {
        return getId(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private int
    getId(java.util.Map<String, String> __ctx, boolean __explicitCtx)
        throws RecordNotCommitted
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("getId");
                __delBase = __getDelegate(false);
                _customerDel __del = (_customerDel)__delBase;
                return __del.getId(__ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public String
    getName()
    {
        return getName(null, false);
    }

    public String
    getName(java.util.Map<String, String> __ctx)
    {
        return getName(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private String
    getName(java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("getName");
                __delBase = __getDelegate(false);
                _customerDel __del = (_customerDel)__delBase;
                return __del.getName(__ctx);
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public void
    save()
        throws DBError
    {
        save(null, false);
    }

    public void
    save(java.util.Map<String, String> __ctx)
        throws DBError
    {
        save(__ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    save(java.util.Map<String, String> __ctx, boolean __explicitCtx)
        throws DBError
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __checkTwowayOnly("save");
                __delBase = __getDelegate(false);
                _customerDel __del = (_customerDel)__delBase;
                __del.save(__ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public void
    setName(String name)
    {
        setName(name, null, false);
    }

    public void
    setName(String name, java.util.Map<String, String> __ctx)
    {
        setName(name, __ctx, true);
    }

    @SuppressWarnings("unchecked")
    private void
    setName(String name, java.util.Map<String, String> __ctx, boolean __explicitCtx)
    {
        if(__explicitCtx && __ctx == null)
        {
            __ctx = _emptyContext;
        }
        int __cnt = 0;
        while(true)
        {
            Ice._ObjectDel __delBase = null;
            try
            {
                __delBase = __getDelegate(false);
                _customerDel __del = (_customerDel)__delBase;
                __del.setName(name, __ctx);
                return;
            }
            catch(IceInternal.LocalExceptionWrapper __ex)
            {
                __handleExceptionWrapper(__delBase, __ex, null);
            }
            catch(Ice.LocalException __ex)
            {
                __cnt = __handleException(__delBase, __ex, null, __cnt);
            }
        }
    }

    public static customerPrx
    checkedCast(Ice.ObjectPrx __obj)
    {
        customerPrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (customerPrx)__obj;
            }
            catch(ClassCastException ex)
            {
                if(__obj.ice_isA("::CustomerRelationsManagement::customer"))
                {
                    customerPrxHelper __h = new customerPrxHelper();
                    __h.__copyFrom(__obj);
                    __d = __h;
                }
            }
        }
        return __d;
    }

    public static customerPrx
    checkedCast(Ice.ObjectPrx __obj, java.util.Map<String, String> __ctx)
    {
        customerPrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (customerPrx)__obj;
            }
            catch(ClassCastException ex)
            {
                if(__obj.ice_isA("::CustomerRelationsManagement::customer", __ctx))
                {
                    customerPrxHelper __h = new customerPrxHelper();
                    __h.__copyFrom(__obj);
                    __d = __h;
                }
            }
        }
        return __d;
    }

    public static customerPrx
    checkedCast(Ice.ObjectPrx __obj, String __facet)
    {
        customerPrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            try
            {
                if(__bb.ice_isA("::CustomerRelationsManagement::customer"))
                {
                    customerPrxHelper __h = new customerPrxHelper();
                    __h.__copyFrom(__bb);
                    __d = __h;
                }
            }
            catch(Ice.FacetNotExistException ex)
            {
            }
        }
        return __d;
    }

    public static customerPrx
    checkedCast(Ice.ObjectPrx __obj, String __facet, java.util.Map<String, String> __ctx)
    {
        customerPrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            try
            {
                if(__bb.ice_isA("::CustomerRelationsManagement::customer", __ctx))
                {
                    customerPrxHelper __h = new customerPrxHelper();
                    __h.__copyFrom(__bb);
                    __d = __h;
                }
            }
            catch(Ice.FacetNotExistException ex)
            {
            }
        }
        return __d;
    }

    public static customerPrx
    uncheckedCast(Ice.ObjectPrx __obj)
    {
        customerPrx __d = null;
        if(__obj != null)
        {
            try
            {
                __d = (customerPrx)__obj;
            }
            catch(ClassCastException ex)
            {
                customerPrxHelper __h = new customerPrxHelper();
                __h.__copyFrom(__obj);
                __d = __h;
            }
        }
        return __d;
    }

    public static customerPrx
    uncheckedCast(Ice.ObjectPrx __obj, String __facet)
    {
        customerPrx __d = null;
        if(__obj != null)
        {
            Ice.ObjectPrx __bb = __obj.ice_facet(__facet);
            customerPrxHelper __h = new customerPrxHelper();
            __h.__copyFrom(__bb);
            __d = __h;
        }
        return __d;
    }

    protected Ice._ObjectDelM
    __createDelegateM()
    {
        return new _customerDelM();
    }

    protected Ice._ObjectDelD
    __createDelegateD()
    {
        return new _customerDelD();
    }

    public static void
    __write(IceInternal.BasicStream __os, customerPrx v)
    {
        __os.writeProxy(v);
    }

    public static customerPrx
    __read(IceInternal.BasicStream __is)
    {
        Ice.ObjectPrx proxy = __is.readProxy();
        if(proxy != null)
        {
            customerPrxHelper result = new customerPrxHelper();
            result.__copyFrom(proxy);
            return result;
        }
        return null;
    }
}
